module.exports = app => {
  const mongoose = require("mongoose");
  const DB_URL = "localhost:27017";
  const DB_NAME = "node-vue-shoes";
  // const DB_NAME = "node-vue-shoes001";
  mongoose.connect(`mongodb://${DB_URL}/${DB_NAME}`, {
    useNewUrlParser: true,
    useUnifiedTopology: true
  });

  const conn = mongoose.connection;
  conn.on("connected", () => {
    console.log("数据库连接成功");
  });
};
